package com.icreate.storm.methods.indicators.fieldCreater;

import com.icreate.entity.indicator.IndicatorID;
import com.icreate.entity.indicator.S1_MMEfield;
import com.icreate.entity.indicator.UE_MRfield;
import com.icreate.storm.methods.common.DateMethod;
import com.icreate.storm.methods.indicators.fieldCreater.FieldCreater;

/**
 * Created by icreate on 2017/5/21.
 */
public class UE_MRfieldCreater extends BaseSubstring implements FieldCreater<UE_MRfield> {
    private int[] indexsBuffer=new int[26];
    @Override
    protected int[] getIndexBuffer() {
        return indexsBuffer;
    }
    public UE_MRfield create(String s) {
        /*
        String[] cells = s.split(",");
        String ts = cells[16];
        String cellid = cells[14];
        String imsi = cells[6];
        String imei = cells[7];
        if (ts.equals("") || cellid.equals("") || imsi.equals(""))
            return null;
        String hour = DateMethod.getHour(ts);
        UE_MRfield field = new UE_MRfield(DateMethod.getDate(ts), cellid, imsi, imei, hour);
        field.setRsrp(cells[24]);
        field.setRsrq(cells[25]);
        field.setUlsinr(cells[20]);
        field.setPhr(cells[18]);
        */
        setSplitIndexes(s);
        String ts = getCell(16); //cells[16];
        String cellid =  getCell(14); // cells[14];
        String imsi =  getCell(6);//cells[6];
        String imei = getCell(7);//cells[7];
        if (ts.equals("") || cellid.equals("") || imsi.equals(""))
            return null;
        String hour = DateMethod.getHour(ts);
        UE_MRfield field = new UE_MRfield(DateMethod.getDate(ts), cellid, imsi, imei, hour);
        field.setRsrp( getCell(24));
        field.setRsrq( getCell(25));
        field.setUlsinr( getCell(20));
        field.setPhr( getCell(18));
        return field;
    }

}
